# Maintainer: Lukas Fleischer <lfleischer@archlinux.org>
# Maintainer: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>

pkgname=libgit2-glib
pkgver=0.26.0
pkgrel=1
pkgdesc="GLib wrapper for libgit2"
url="http://wiki.gnome.org/Projects/Libgit2-glib"
license=(LGPL2.1)
arch=(i686 x86_64)
depends=(glib2 libgit2)
makedepends=(gobject-introspection python vala gtk-doc)
source=("https://ftp.gnome.org/pub/GNOME/sources/$pkgname/${pkgver:0:4}/$pkgname-$pkgver.tar.xz")
sha256sums=('06b16cfcc3a53d9804858618d690e5509e9af2e2245b75f0479cadbbe39745c3')

prepare() {
  cd "$pkgname-$pkgver"
}

build() {
  cd "$pkgname-$pkgver"

  ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --enable-gtk-doc

  # https://bugzilla.gnome.org/show_bug.cgi?id=655517
  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool

  make
}

check() {
  cd "$pkgname-$pkgver"
  make check
}

package() {
  cd "$pkgname-$pkgver"
  make DESTDIR="$pkgdir" install
}
